package ${rootpackage}${moduleLow}.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.clgk.wechatmall.common.sql.Page;
import com.clgk.wechatmall.common.Response;
import ${rootpackage}${moduleLow}.service.${module}Service;
import ${rootpackage}${moduleLow}.bean.${module}Bean;

@Controller
@RequestMapping("${module}")
public class ${module}Action {
	@Resource ${module}Service ${module}Service;
	
	
	
	/**
	 * 保存${tablecomment}
	 * @param bean
	 */
	@RequestMapping("save")
	@ResponseBody
	public Response<Long> save(${module}Bean bean){
		Response<Long> response = new Response<Long>(); 
		response.setData(this.${module}Service.save(bean));
		return response;
	}
	
	/**
	 * 修改${tablecomment}
	 * @param bean
	 */
	@RequestMapping("update")
	@ResponseBody
	public Response<Integer> update(${module}Bean bean){
		Response<Integer> response = new Response<Integer>(); 
		response.setData(this.${module}Service.update(bean));
		return response;
	}
	
	/**
	 * 查询${tablecomment}
	 * @param bean
	 * @param page
	 * 
	 */
	@RequestMapping("queryList")
	@ResponseBody
	public Response<List<${module}Bean>> queryList(${module}Bean bean,Page page) {
		Response<List<${module}Bean>> response = new Response<List<${module}Bean>>(); 
		List<${module}Bean> list=this.${module}Service.queryList(bean, page);
		response.setData(list);
		response.setPage(page);
		return response;
	}
	
	
	
	
	/**
	 * 删除${tablecomment}
	 * @param ids
	 */
	@RequestMapping("deleteByIds")
	@ResponseBody
	public Response<Integer> deleteByIds(String ids) {
		Response<Integer> response = new Response<Integer>(); 
		response.setData(this.${module}Service.deleteByIds(ids));
		return response;
	}

}
